%% Calibration of primitives and key functions
pi = 0.05; %default probability
N = 3*7; %number of entities
K = 10; %number of derivative classes
alpha_uc = 0.99; %margin confidence level uncleared
alpha_CCP = 0.99; %margin confidence level cleared
sigma = 1; %idiosyncratic volatility
sigma_M = 1; %systematic volatility
beta = 0.3; %systematic risk exposure
G_per = 1; %position size for peripheral entities

xi = @(alpha) (1-alpha).*norminv(1-alpha) + normpdf(norminv(alpha));
f = @(K,beta) sqrt(beta.^2.*sigma_M.^2.*K.^2 + sigma.^2.*K); %multiplier for portfolio risk